﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.OleDb;
using DAO;
using DTO;

namespace BUS
{
    public class DatHangBUS
    {
        public DataSet LoadFormBUS(DateTime From, DateTime To)
        {
            DatHangDAO DHDAO = new DatHangDAO();
            return DHDAO.LoadFromDAO(From, To);
        }

        public List<DatHangDTO> LayTatCaDatHang()
        {
            DatHangDAO dao = new DatHangDAO();
            return dao.LayTatCaDatHang();
        }
        public int LoadMADH()
        {
            DatHangDAO DHDAO = new DatHangDAO();
            return DHDAO.LoadMADH();
            
        }
        public DataSet GetSanPham()
        {
            DatHangDAO DHDAO= new DatHangDAO();
            return DHDAO.GetSanPham();
        }
        public DataSet DsSanpham(int id)
        {
            DatHangDAO DHDAO = new DatHangDAO();
            return DHDAO.DsSanpham(id);
        }
        public int INSERTDH(DatHangDTO INPUT)
        {
            DatHangDAO DHDAO = new DatHangDAO();
            return DHDAO.INSERTDH(INPUT);
      
        }
        public int INSERTCTDH(CTDatHangDTO INPUT)
        {
            DatHangDAO DHDAO = new DatHangDAO();
            return DHDAO.INSERTCTDH(INPUT);

        }
        public int DELETECTDH(int INPUT)
        {
            DatHangDAO DHDAO = new DatHangDAO();
            return DHDAO.DeleteCTDH(INPUT);
        }
        public DataSet SELECTTENNV ()
        {
            DatHangDAO DHDAO = new DatHangDAO();
            return DHDAO.SELECTTENNV();
        }
        public int REURNMANV(string INPUT)
        {
            DatHangDAO DHDAO = new DatHangDAO();
            return DHDAO.RETURNMANV(INPUT);
        }
        public DataSet RETURNTENNV(int INPUT)
        {
            DatHangDAO DHDAO = new DatHangDAO();
            return DHDAO.RETURNTENNV(INPUT);
        }
        public int DELETEDH(int INPUT)
        {
            DatHangDAO DHDAO = new DatHangDAO();
            return DHDAO.DeleteDH(INPUT);
        }
        public DataSet LOADDH(int INPUT)
        {
            DatHangDAO DHDAO = new DatHangDAO();
            return DHDAO.LOADDH(INPUT);
        }
        public DataSet FINDSP(int INPUT)
        {
            DatHangDAO DHDAO = new DatHangDAO();
            return DHDAO.FINDSP(INPUT);
        }
        public int COUNTDH()
        {
            DatHangDAO DHDAO = new DatHangDAO();
            return DHDAO.CountDH();
        }
    }
}
